//hoc高阶组件:不是api是一种策略模式
import React, { useEffect } from "react";
import Hoc from "./Hoc";
// 想hoc组件传入的
const Fn = (props) => {
  return (
    <div>
      <button onClick={props.handleClick}>我是一个子组件,点击有惊喜</button>
    </div>
  );
};
const Fa =(props)=>{
    return <div>
        <a onClick={props.handleClick}>点</a>
    </div>
}
const App = () => {
  const MyHoc = Hoc(Fn);
  const Fc = Hoc(Fa)
  const ref = React.createRef()
  useEffect(()=>{
    console.log(ref)
  },[])
  return <div>高阶组件的使用
      <MyHoc ref={ref}></MyHoc>
      <Fc></Fc>
  </div>;
};

export default App;
